Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce app.timer #4091

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Introduce app.timer #4091

wants to merge 7 commits into from

Conversation

falkoschindler
Copy link
Contributor

@falkoschindler falkoschindler commented Dec 11, 2024

This PR implements one of our most-wanted feature requests #3225, an API for timing UI-independent function calls.

The current draft can be tested like this:

import time
from nicegui import app, ui

timer = app.timer(0.5, lambda: print(time.time()))
ui.button('Start', on_click=timer.start)
ui.button('Stop', on_click=timer.stop)
ui.switch('Running').bind_value(timer, 'running')

ui.run()

Open tasks:

@falkoschindler falkoschindler added the enhancement New feature or request label Dec 11, 2024
@falkoschindler falkoschindler added this to the 2.9 milestone Dec 11, 2024
@falkoschindler falkoschindler marked this pull request as ready for review December 12, 2024 08:38
@falkoschindler falkoschindler requested a review from rodja December 12, 2024 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant